home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shadez.swf / scripts / Local / Draw / CScreen_SelectLevel.as < prev    next >
Encoding:
Text File  |  2011-08-19  |  4.6 KB  |  144 lines

  1. package Local.Draw
  2. {
  3.    import Local.External.*;
  4.    import Local.Game.Level.*;
  5.    import STC9.IO.*;
  6.    import flash.display.*;
  7.    import flash.events.*;
  8.    import flash.geom.*;
  9.    
  10.    public class CScreen_SelectLevel extends CScreen
  11.    {
  12.        
  13.       
  14.       public var mcButtonLevelIcon1:MovieClip;
  15.       
  16.       public var mcButtonLevelIcon3:MovieClip;
  17.       
  18.       public var mcButtonLevelIcon4:MovieClip;
  19.       
  20.       public var mcButtonLevelIcon2:MovieClip;
  21.       
  22.       public var mcBackground:MovieClip;
  23.       
  24.       public var mcLogo:MovieClip;
  25.       
  26.       public var mcButtonBack:MovieClip;
  27.       
  28.       public var mcMoreGames:MovieClip;
  29.       
  30.       public var mcButtonStartWar:MovieClip;
  31.       
  32.       public var mcSize:MovieClip;
  33.       
  34.       public function CScreen_SelectLevel()
  35.       {
  36.          var _loc1_:int = 0;
  37.          if(true)
  38.          {
  39.             super();
  40.             if(true)
  41.             {
  42.                AddButton("startwar",new CScreenButton(mcButtonStartWar,Button_Default)).addEventListener(CScreenButton.MOUSECLICK,e_STARTLEVEL);
  43.                if(true)
  44.                {
  45.                   AddButton("level0",new CScreenButton(mcButtonLevelIcon1,Level_Icon_Vis)).addEventListener(CScreenButton.MOUSECLICK,e_SELECTLEVEL);
  46.                   if(true)
  47.                   {
  48.                      AddButton("level1",new CScreenButton(mcButtonLevelIcon2,Level_Icon_Vis)).addEventListener(CScreenButton.MOUSECLICK,e_SELECTLEVEL);
  49.                   }
  50.                   AddButton("level2",new CScreenButton(mcButtonLevelIcon3,Level_Icon_Vis)).addEventListener(CScreenButton.MOUSECLICK,e_SELECTLEVEL);
  51.                }
  52.                AddButton("level3",new CScreenButton(mcButtonLevelIcon4,Level_Icon_Vis)).addEventListener(CScreenButton.MOUSECLICK,e_SELECTLEVEL);
  53.             }
  54.             _loc1_ = 0;
  55.          }
  56.          while(_loc1_ < 4)
  57.          {
  58.             SelectLevel(_loc1_);
  59.             DeselectLevel(_loc1_);
  60.             _loc1_++;
  61.          }
  62.          AddLogoButton();
  63.          AddBackButton("main");
  64.          AddMoreGamesButton("SelectLevel");
  65.          SelectLevel(0);
  66.       }
  67.       
  68.       private function e_SELECTLEVEL(param1:Event = null) : void
  69.       {
  70.          var _loc2_:CScreenButton = null;
  71.          _loc2_ = CScreenButton(param1.currentTarget);
  72.          SelectLevel(Number(_loc2_.mID.substr(_loc2_.mID.length - 1)));
  73.       }
  74.       
  75.       private function e_VIEWSCORES(param1:MouseEvent = null) : void
  76.       {
  77.          CURL.ViewHiscore(CLevelData.mGameID);
  78.       }
  79.       
  80.       private function e_STARTLEVEL(param1:Event = null) : void
  81.       {
  82.          var _loc2_:CScreenButton = null;
  83.          _loc2_ = CScreenButton(param1.currentTarget);
  84.          CLevelData.mMochiBotTrack();
  85.          mParent.GetScreen("loadinglevel").Activate();
  86.       }
  87.       
  88.       private function DeselectLevel(param1:int) : void
  89.       {
  90.          var _loc2_:MovieClip = null;
  91.          _loc2_ = mButtons["level" + param1].mcButton;
  92.          _loc2_.bViewScores.visible = false;
  93.          _loc2_.mcSelected.visible = false;
  94.          _loc2_.mcSelected.enabled = false;
  95.          mButtons["level" + param1].mEnabled = true;
  96.       }
  97.       
  98.       private function SelectLevel(param1:int) : void
  99.       {
  100.          var _loc2_:int = 0;
  101.          var _loc3_:MovieClip = null;
  102.          if(true)
  103.          {
  104.             _loc2_ = 0;
  105.          }
  106.          for(; _loc2_ < 4; _loc2_++)
  107.          {
  108.             if(_loc2_ != param1)
  109.             {
  110.                if(false)
  111.                {
  112.                   _loc3_ = mButtons["level" + param1].mcButton;
  113.                   if(true)
  114.                   {
  115.                      _loc3_.tbName.text = CLevelData.mName + " (" + CLevelData.mDifficulty + ")";
  116.                      if(true)
  117.                      {
  118.                         _loc3_.mcGraphic.gotoAndStop(1 + param1);
  119.                         if(true)
  120.                         {
  121.                            _loc3_.bViewScores.visible = true;
  122.                            _loc3_.bViewScores.addEventListener(MouseEvent.MOUSE_DOWN,e_VIEWSCORES);
  123.                         }
  124.                         _loc3_.mcSelected.visible = true;
  125.                      }
  126.                      mButtons["level" + param1].mEnabled = false;
  127.                   }
  128.                   return;
  129.                }
  130.                DeselectLevel(_loc2_);
  131.                if(false)
  132.                {
  133.                   break;
  134.                }
  135.                continue;
  136.                addr37:
  137.             }
  138.          }
  139.          CLevelData.mLevelIndex = param1;
  140.          ┬º┬ºgoto(addr37);
  141.       }
  142.    }
  143. }
  144.